export default {
  namespaced: true,
  state: {
    // 顶部菜单
    header: [],
    // 侧栏菜单
    sider: [],
    // 当前顶栏菜单的 name
    headerName: '',
    // 当前所在菜单的 path
    activePath: '',
    // 展开的子菜单 name 集合
    openNames: [],
    // 是否展开
    collapsed: true
  },
  mutations: {
    setCollapsed (state: { collapsed: boolean }) {
      state.collapsed = !state.collapsed
    }
  },
  actions: {
    toggleCollapsed (context: any) {
      context.commit('setCollapsed')
    }
  }
}
